/**
 * 
 */
package com.notifier;

import java.util.ArrayList;
import java.util.List;

import com.iface.IAlarmGenerator;
import com.iface.IMessageObserver;

/**
 * @author shripad
 *
 */
public class AlarmGenerator implements IAlarmGenerator {
	
	private List<IMessageObserver> messageObservers = new ArrayList<IMessageObserver>(); 

	@Override
	public String generateAlarm(String message) {
		for(IMessageObserver messageObserver : this.messageObservers) {
			messageObserver.pushMessage(message);
		}
		// TODO return the message for successful message delivery
		return null;
	}

	/**
	 * @param messageObservers the messageObservers to set
	 */
	public void setMessageObservers(final List<IMessageObserver> messageObservers) {
		this.messageObservers = messageObservers;
	}

}
